package org.timeticker;

import org.timeticker.DayRange;

import java.io.Serializable;
import java.util.Date;

/**
 * Activity list that represent list of activities that took place during specified date range<br/>
 * Implementation must be thread safe.
 *
 * @author Ivan Latysh
 * @version 0.1
 * @since 16-Jul-2007 : 7:37:26 PM
 */
public interface ActivityList extends ObjectList<Activity>, Serializable {

  /**
   * Return date range
   *
   * @return date range
   */
  public DayRange getDateRange();

  /**
   * Set day range
   *
   * @param day day range to set
   */
  public void setDateRange(DayRange day);

  /**
   * Return daily activity list
   *
   * @param day day
   * @return activity list or null
   */
  public DailyActivityList getDailyActivity(Day day);

  /**
   * Add DailyActivityList
   *
   * @param list list to add
   */
  public void addDailyActivity(DailyActivityList list);

  /**
   * Return activity in progress or null if no activity in a progress.<br/>
   *
   * @return activity in progress or <tt>null</tt>
   */
  public Activity getActivityInProgress();

  /**
   * Start given activity
   *
   * @param activity activity to start
   * @throws IllegalArgumentException when given activity is not a part of current activities
   */
  public void start(Activity activity) throws IllegalArgumentException;

  /**
   * Stop given activity
   *
   * @param activity activity to stop
   * @throws IllegalArgumentException when given activity is not a part of current activities
   */
  public void stop(Activity activity) throws IllegalArgumentException;

  /**
   * Add activity listener
   *
   * @param l activity listener to add
   */
  public void addActivityListener(ActivityListener l);

  /**
   * Remove activity listener
   *
   * @param l activity listener to remove
   */
  public void removeActivityListener(ActivityListener l);

}
